<!DOCTYPE html>
<html lang="en" xmlns:th="">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>分类</title>
    <link rel="icon" th:href="@{/images/type.png}" sizes="32x32">
</head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
<link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
<link rel="stylesheet" href="../static/css/mouseeffect.css.css" th:href="@{/css/mouseeffect.css}">

<body>
<!-- 导航 -->
<nav th:replace="_fragments :: menu(2)"></nav>

<!-- 中间内容 -->
<div class="m-padded-tb-large">

    <div class="ui container">
        <!-- herder -->
        <div class="ui top attached segment">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <h3 class="ui teal header">博客</h3>
                </div>
                <div class="right aligned column">
                    共 <h2 class="ui orange header m-inline-block m-padded-tb-mini"
                          th:text="${#arrays.length(types)}"></h2>篇
                </div>
            </div>
        </div>
        <!-- 分类标签 -->
        <div class="ui attached segment">
            <div class="ui labeled button" th:each="type : ${types}">
                <a th:href="@{/types/{id}(id=${type.id})}" class="ui basic button"
                   th:classappend="${type.id==activeTypeId} ? 'teal'" th:text="${type.name}"></a>
                <div class="ui basic left pointing label" th:classappend="${type.id==activeTypeId} ? 'teal'"
                     th:text="${#arrays.length(type.blogs)}">
                </div>
            </div>

        </div>
        <!-- 内容 -->
        <div class="ui top attached teal segment">
            <div class="ui padded vertical segment m-padded-tb-large" th:each="blog : ${page.content}">
                <div class="ui middle aligned mobile reversed stackable grid">
                    <div class="eleven wide column">
                        <h3 class="ui teal header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank"
                                                      class="m-black" th:text="${blog.title}" style="color: black">该起什么标题好呢</a>
                        </h3>
                        <p class="m-text"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}"
                                             th:text="|${blog.description}......|"
                                             class="m-black">我到底在这里写了些什么</a></p>
                        <div class="ui grid">
                            <div class="eleven wide column">
                                <div class="ui mini horizontal link list">
                                    <div class="item">
                                        <img src="https://unsplash.it/100/100?image=1005" alt="" class="ui avatar image"
                                             th:src="@{${blog.user.avatar}}">
                                        <div class="content"><a href="#" class="header"
                                                                th:src="@{${blog.user.nickname}}">Joker</a></div>
                                    </div>
                                    <div class="item">
                                        <i class="calendar icon"></i><span
                                            th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2021-07-28</span>
                                    </div>
                                    <div class="item">
                                        <i class="eye icon"></i><span th:text="${blog.views}">浏览次数</span>
                                    </div>
                                </div>
                            </div>
                            <div class="right aligned five wide column">
                                <a href="#" target="_blank" class="ui teal basic label m-padded-small"
                                   th:text="${blog.type.name}">认知升级</a>
                            </div>
                        </div>
                    </div>
                    <div class="five wide column">
                        <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                            <img src="https://unsplash.it/800/450?image=1005" alt="" class="ui rounded image"
                                 th:src="@{${blog.firstPicture}}">
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <!-- 分页 -->
        <div class="ui bottom attached segment" th:if="${page.totalPages}>1">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <a href="#" th:href="@{'/types/'+${activeTypeId}(page=${page.number}-1)}" class="ui mini teal basic button"
                       th:unless="${page.first}">上一页</a>
                </div>
                <div class="column right aligned">
                    <a href="#" th:href="@{'/types/'+${activeTypeId}(page=${page.number}+1)}" class="ui mini teal basic button"
                       th:unless="${page.last}">下一页</a>
                </div>
            </div>
        </div>
    </div>

</div>
<div>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
</div>

<!-- 底部footer -->
<footer th:replace="_fragments :: footer"></footer>

</body>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
<script type="text/javascript" th:src="@{/js/mouse.js}"></script>
<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
        return false;
    });


    // $('#playButton').popup({
    //     popup: $('.pay.popup'),
    //     on: 'click',
    //     position: 'buttom center'
    // });

</script>
<style>
    body {
        background: url('https://static.talkxj.com/config/83be0017d7f1a29441e33083e7706936.jpg') center center / cover no-repeat;
        background-attachment: fixed;
    }
</style>

</html>